package com.dfzt.myutils.personal;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class HourlyWeather {
    // 时间格式化工具
    private static final DateTimeFormatter ISO_FORMATTER =
            DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mmXXX");

    private LocalDateTime datetime;
    private Double temperature;    // 温度（℃）
    private Double cloudrate;      // 云量（0-1）
    private Double windSpeed;      // 风速（m/s）
    private Integer windDirection; // 风向（度）
    private Double humidity;       // 湿度（0-1）
    private Integer pm25;          // PM2.5浓度
    private Integer lightIntensity;// 光照强度（lux）

    // 转换ISO时间格式
    public void setDatetime(String isoTime) {
        this.datetime  = LocalDateTime.parse(isoTime,  ISO_FORMATTER);
    }

    public LocalDateTime getDatetime() {
        return datetime;
    }

    public void setDatetime(LocalDateTime datetime) {
        this.datetime = datetime;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Double getCloudrate() {
        return cloudrate;
    }

    public void setCloudrate(Double cloudrate) {
        this.cloudrate = cloudrate;
    }

    public Double getWindSpeed() {
        return windSpeed;
    }

    public void setWindSpeed(Double windSpeed) {
        this.windSpeed = windSpeed;
    }

    public Integer getWindDirection() {
        return windDirection;
    }

    public void setWindDirection(Integer windDirection) {
        this.windDirection = windDirection;
    }

    public Double getHumidity() {
        return humidity;
    }

    public void setHumidity(Double humidity) {
        this.humidity = humidity;
    }

    public Integer getPm25() {
        return pm25;
    }

    public void setPm25(Integer pm25) {
        this.pm25 = pm25;
    }

    public Integer getLightIntensity() {
        return lightIntensity;
    }

    public void setLightIntensity(Integer lightIntensity) {
        this.lightIntensity = lightIntensity;
    }
}
